package com.sctvcloud.pingwu.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.pingwu.R;
import com.sctvcloud.pingwu.beans.CircleBean;
import com.sctvcloud.pingwu.ui.adapter.holder.CommonCircleHolder;
import com.sctvcloud.pingwu.ui.util.IListShowData;

import java.util.List;

public class CommonCircleAdapter<T extends IListShowData> extends BaseHolderAbsAdapter<CircleBean, CommonCircleHolder> {

    private boolean isAct = false;

    public CommonCircleAdapter(Context context, List<CircleBean> list ) {
        super(context, list);
    }

    public void setAct(boolean isAct) {
        this.isAct = isAct;
    }


    @Override
    public CommonCircleHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_commont_circle, parent, false);
        CommonCircleHolder holder = new CommonCircleHolder(context, view);
        holder.setAct(isAct);
        holder.setType(viewType);
        holder.setInternalClick(this);
        return holder;
    }

    @Override
    public CommonCircleAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
        super.setItemInternalClick(itemInternalClick);
        return this;
    }

    @Override
    public int getItemViewType(int position) {
        return 0;
    }
}
